package ru.ipccenter.jshell.frontend.shell;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Collection;

import ru.ipccenter.jshell.InterprocessStream;
import ru.ipccenter.jshell.Shell;

public class ShellProxy implements Shell {

    protected ShellInternal shell;
    
    public ShellProxy(InputStream input, OutputStream output, OutputStream error) {
        
        shell = new ShellInternalImpl(input, output, error);
    }   
    
    public ShellProxy(ShellInternal shell) {

        this.shell = shell;
    }
    
    @Override
    public InterprocessStream read() {
       
        return shell.read();
    }

    @Override
    public InterprocessStream read(String file) throws IOException {

        return shell.read(file);
    }

    @Override
    public InterprocessStream exec(String... args) {
        
        return shell.exec(args);
    }

    @Override
    public void cd(String path) {
        
        shell.cd(path);
    }

    @Override
    public void pwd() {

        shell.pwd();
    }
    
    @Override
    public Object getEnv(String key){
        return shell.getEnv(key);
    }
    
    @Override
    public void setEnv(String key,Object o){
        shell.setEnv(key, o);
    }
    
    @Override 
    public Collection<Object> Env(){
        return shell.Env();
    }

}
